// 1. 安装路由模块
// yarn add vue-router

// 2. 导入模块
import Vue from 'vue'

import VueRouter from 'vue-router'

// 3.注册路由组件 <routet-view> <router-link> 
Vue.use(VueRouter)

// 4.路由映射关系
import Home from '../views/Home.vue'
import Member from '../components/Member.vue'
import Shopping from '../components/Shopping.vue'
import Search from '../components/Search.vue'
import Information from '../views/Information.vue'
import Informdetails from '../views/Informdetails.vue'
import Picture from '../views/Picture.vue'
import Goods from '../views/Goods.vue'
const routes = [
    { path: '/', redirect: '/home' },
    { path: '/home', component: Home },
    { path: '/member', component: Member },
    { path: '/shopping', component: Shopping },
    { path: '/search', component: Search },
    { path: '/information', component: Information },
    { path: '/informdetails/:newid', component: Informdetails },
    { path: '/picture', component: Picture },
    { path: '/goods', component: Goods },
]
// 5. new 一个路由实例
const router = new VueRouter({
    routes,
    mode: 'history'
})


// 6.1  导出路由实例
export default router